package com.blazingredfireball.rouleurlog.ria.business
{
	import mx.rpc.IResponder;
	import com.adobe.cairngorm.business.ServiceLocator;
	
	public class UserDelegate
	{
		private var responder : IResponder;
		private var service : Object;
		
		public function UserDelegate(responder : IResponder)
		{
			this.service = ServiceLocator.getInstance().getService( "userService" );
			this.responder = responder;
		}
		
		public function loginUser(username : String, password : String) : void
		{			
			var call : Object = service.authenticate(username, password);
			call.resultHandler = responder.result;
			call.faultHandler = responder.fault;	
		}
		
		public function registerUser(username : String, password : String) : void
		{			
			var call : Object = service.register(username, password);
			call.resultHandler = responder.result;
			call.faultHandler = responder.fault;	
		}
	}
}